package yhao.demo.service.erp.workflow.dao;

import yhao.demo.service.erp.workflow.apilist.form.flow.*;
import yhao.demo.service.erp.workflow.apilist.model.flow.*;
import yhao.infra.common.model.Pagination;

import java.util.List;

public interface ProcessDao {
    void insertProcessDefinition(FlowProcessDefinitionForm form);

    void batchInsertFlowNode(List<FlowNodeForm> nodes);

    void batchInsertFlowTransition(List<FlowTransitionForm> nodes);

    void overrideProcessDefinitionById(String id);

    void overrideProcessDefinitionByBizCode(String bizCode);

    void updateBizCode(FlowProcessBizCodeChangeForm form);

    void saveNodeTemplate(FlowNodeTemplateForm form);

    void updateNodeTemplate(FlowNodeTemplateForm form);

    List<FlowProcessDefinitionModel> queryProcessDefinitionByBizCode(String bizCode);

    List<FlowNodeModel> queryNodeByProcessId(String id);

    List<FlowTransitionModel> queryTransitionByProcessId(String id);

    void updateNodeItemTemplate(FlowNodeItemTemplateForm form);

    void saveNodeItemTemplate(FlowNodeItemTemplateForm form);

    void batchInsertFlowNodeItem(List<FlowNodeItemForm> itemList);

    void batchInsertFlowNodeNotify(List<FlowNodeNotifyForm> notifyList);

    void insertFlowNodeWarn(FlowNodeWarnForm warnForm);

    FlowNodeWarnModel selectNodeWarnByNodeId(String nodeId);

    void insertFlowNodeWarnTemplate(FlowNodeWarnForm warnForm);

    void updateFlowNodeWarnTemplate(FlowNodeWarnForm warnForm);

    FlowNodeWarnTemplateModel selectTemplateNodeWarnByTemplateNodeId(String nodeId);

    List<FlowNodeTemplateModel> queryAllNodeTemplate();

    /**
     * 注意通过id获取的流程记录，可能不是最新的
     * **/
    FlowProcessDefinitionModel selectProcessDefinitionById(String id);

    List<FlowNodeItemModel> queryNodeItemByNodeId(String nodeId);

    void queryProcessDefinition(Pagination<FlowProcessDefinitionModel> page, FlowProcessQueryForm form);
}
